package com.example.security.mapper;

import com.example.security.dmo.SysUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper {
    @Select("select * from sys_user where username = #{username}")
    SysUser getUserInfoByUsername(String username);

    @Insert("insert into sys_user(username, password, role) value(#{username}, #{password}, #{role})")
    int insertUser(SysUser user);

    @Update("update sys_user set password = #{newPwd} where username = #{username}")
    int updateUser(String username,String newPwd);
}
